<template>
  <el-card class="box-card" style="width: 600px">
    <div slot="header" class="clearfix" style="font-size: 22px; font-weight: 600">
      <span>所在公司</span>
      <span style="float: right">所在公司数： {{ length }}</span>
    </div>
    <div v-for="(name, index ) in companyList" :key="index" class="text item">
      <el-row style="font-size: 20px; margin-top: 15px">
        <el-col :span="16">
          {{ name.name }}
        </el-col>
        <el-col v-if="name.employeeCount" :span="8">
          员工数： {{ name.employeeCount }}人
        </el-col>
      </el-row>
      <hr>
    </div>
  </el-card>

</template>

<script>

import {copyObj} from "../common/utils";

export default {
  name: "card",
  data() {
    return {
      companyList: [],
      length: ""
    }
  },
  methods: {},
  mounted() {
  },
  watch: {
    "number": {
      handler(a) {
        this.companyList = copyObj(a);
        this.length = a.length;
      }
    }
  },
  props: ['number']
}
</script>

<style scoped>
/*.text {*/
/*  font-size: 20px;*/
/*}*/

/*.item {*/
/*  margin-bottom: 18px;*/
/*}*/

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both
}


</style>